<!DOCTYPE html>
<html>	
<head>
<title>Login</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<meta name="keywords" content="Flat Dark Web Login Form Responsive Templates, Iphone Widget Template, Smartphone login forms,Login form, Widget Template, Responsive Templates, a Ipad 404 Templates, Flat Responsive Templates" />
<link href="css/style.css" rel='stylesheet' type='text/css' />
<!--webfonts-->
<link href='http://fonts.useso.com/css?family=PT+Sans:400,700,400italic,700italic|Oswald:400,300,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.useso.com/css?family=Exo+2' rel='stylesheet' type='text/css'>
<!--//webfonts-->
<script src="js/jquery.min.js"></script>
</head>
<body>
<script>$(document).ready(function(c) {
	$('.close').on('click', function(c){
		$('.login-form').fadeOut('slow', function(c){
	  		$('.login-form').remove();
		});submit
	});	  
});
</script>
 <!--SIGN UP-->
 <h1>注册</h1>
<div class="login-form">
	<div class="close"> </div>
		<div class="head-info">
			<label class="lbl-1"> </label>
			<label class="lbl-2"> </label>
			<label class="lbl-3"> </label>
		</div>
			<div class="clear"> </div>
	<div class="avtar">
		<img src="images/avtar.png" />
	</div>
			<form>
	<input type="text" class="text" id="p" placeholder="phone">
	
	<input type="text" class="text" id="name" placeholder="姓名">
	<input type="text" class="text" id="sex" placeholder="性别">
	<input type="text" class="text" id="position" placeholder="职位">
	<input type="text" class="text" id="department" placeholder="部门">
		<div class="key">
		<input type="password" id="s" placeholder="password">
	</div>
</form>
	<div class="signin">
		<input type="submit" value="注册"  id="btn">
	</div>
<input type="button" value="登陆"  id="btn01" style="background-color: black; color: #fff;">
	 <span id="sho" style="color:red;"></span>
</div>

<script>

	$('#btn01').click(function() {
					window.location.href="index.html"
			});
			
			
	$(function() {
		$('#btn').click(function() {
			var phone = $("#p").val();
			var password = $("#s").val();
			var name = $("#name").val();
			var sex = $("#sex").val();
			var position = $("#position").val();
			var department = $("#department").val();
			if(phone =='' | password == ''){
				$('#sho').text("请输入账号或密码").fadeIn(1000)
				$('#sho').text("请输入账号或密码").fadeOut(1000)
			}
			$.ajax({
				type: "POST",
				url: "http://localhost:8088/user",
				async: true,
				dataType: "json",
				data: {
					phone: phone,
					password: password,
					name: name,
					sex: sex,
					position: position,
					department: department,
				},
				success: function(data) {
					console.log(data)
					console.log(data.resp_code)
					if (data.resp_code == 000000) {
						window.location.href="index.html"
					} else {
						$('#sho').text(data.resp_message).fadeIn(1000)
						$('#sho').text(data.resp_message).fadeOut(1000)
					}
				},
				error: function(data) {
					console.log(data);
				}
			})
		});
		
		
	});
</script>
		

</body>
</html>